﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="ViewStudentCourse.aspx.cs" Inherits="SARS.Course.ViewStudentCourse" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <script type="text/javascript" language="javascript">
        function CheckAllEmp(Checkbox) {
            var grvStudents = document.getElementById("<%= grvStudents.ClientID %>");
            for (i = 1; i < grvStudents.rows.length; i++) {
                grvStudents.rows[i].cells[6].getElementsByTagName("INPUT")[0].checked = Checkbox.checked;
            }
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h1>Assign Student to Course</h1>
    <br />
    <table>
        <tr>
            <td>
                <asp:Label ID="Label1" runat="server" Text="Program:" style="font-weight: 700"></asp:Label>
            </td>
            <td>
                <asp:Label ID="lblProgram" runat="server" Text=""></asp:Label>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="Label2" runat="server" Text="Course:" style="font-weight: 700"></asp:Label>
            </td>
            <td>
                <asp:Label ID="lblCourse" runat="server" Text="Label"></asp:Label>
            </td>
        </tr>
        <%--<tr>
            <td>
                <asp:Label ID="Label3" runat="server" style="font-weight: 700" Text="Status:"></asp:Label>
            </td>
            <td>
                <asp:DropDownList ID="ddlStatuses" runat="server">
                    <asp:ListItem Text="All" Value="All"></asp:ListItem>
                    <asp:ListItem Text="Permanent" Value="1"></asp:ListItem>
                    <asp:ListItem Text="Temporary" Value="0"></asp:ListItem>
                </asp:DropDownList>
            </td>
        </tr>--%>
        <tr>
            <td>
                <asp:Label ID="Label4" runat="server" style="font-weight: 700" Text="Name:"></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="txtQuery" runat="server"></asp:TextBox>
                <asp:Button ID="btnSearch" runat="server" onclick="btnSearch_Click" 
                            Text="Search" />
            </td>
        </tr>
        <tr>
            <td>
            </td>
            <td>
                <asp:GridView ID="grvStudents" runat="server" AutoGenerateColumns="False" CellPadding="4"
                              ForeColor="#333333" GridLines="None" 
                              onrowdatabound="grvStudents_RowDataBound"
                              EmptyDataText="There is no student in selected course.">
                    <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                    <Columns>
                        <asp:BoundField DataField="FirstName" HeaderText="First Name" ReadOnly="True" SortExpression="FirstName" />
                        <asp:BoundField DataField="LastName" HeaderText="Last Name" ReadOnly="True" SortExpression="LastName" />
                        <asp:BoundField DataField="DOB" DataFormatString="{0:dd-MMM-yyyy}" HeaderText="Date Of Birth"
                                        ReadOnly="True" SortExpression="DOB" />
                        <asp:BoundField DataField="Phone" HeaderText="Phone" ReadOnly="True" SortExpression="Phone" />
                        <asp:BoundField DataField="Email" HeaderText="Email" ReadOnly="True" SortExpression="Email" />
                        <asp:TemplateField>
                            <HeaderTemplate>
                                
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:DropDownList runat="server" ID="ddlGrvStatuses">
                                    <asp:ListItem Text="Permanent" Value="1"></asp:ListItem>
                                    <asp:ListItem Text="Temporary" Value="0"></asp:ListItem>
                                </asp:DropDownList>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <HeaderTemplate>
                                <asp:CheckBox runat="server" ID="cbxSelectAll" onclick="CheckAllEmp(this);"/>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:CheckBox runat="server" ID="ckbIsAbsent" />
                                <asp:HiddenField runat="server" ID="hdnStudentID" Value="<% #Bind('UserID') %>" />
                            </ItemTemplate>
                            <FooterStyle HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Center" />
                        </asp:TemplateField>
                    </Columns>
                    <EditRowStyle BackColor="#999999" />
                    <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                    <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                    <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                    <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                    <SortedAscendingCellStyle BackColor="#E9E7E2" />
                    <SortedAscendingHeaderStyle BackColor="#506C8C" />
                    <SortedDescendingCellStyle BackColor="#FFFDF8" />
                    <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
                </asp:GridView>
            </td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
            <td style="text-align: right">
                <asp:Button ID="btnSave" runat="server" onclick="btnSave_Click" Text="   Save   " />
                <asp:Button ID="btnCancel" runat="server" CausesValidation="False" 
                            onclick="btnCancel_Click" Text="  Cancel  " />
            </td>
        </tr>
    </table>
</asp:Content>